home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Navig / navig.frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-05-06  |  10.8 KB  |  358 lines

  1. VERSION 4.00
  2. Begin VB.Form Navig 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "AddFlow Navigation tests"
  5.    ClientHeight    =   5220
  6.    ClientLeft      =   1080
  7.    ClientTop       =   930
  8.    ClientWidth     =   6390
  9.    Height          =   5910
  10.    Left            =   1020
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5220
  16.    ScaleWidth      =   6390
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   300
  19.    Width           =   6510
  20.    Begin VB.CommandButton Command1 
  21.       Caption         =   "Selected Links"
  22.       Height          =   375
  23.       Index           =   11
  24.       Left            =   4680
  25.       TabIndex        =   12
  26.       Top             =   4740
  27.       Width           =   1575
  28.    End
  29.    Begin VB.CommandButton Command1 
  30.       Caption         =   "Owned Nodes"
  31.       Height          =   375
  32.       Index           =   10
  33.       Left            =   4680
  34.       TabIndex        =   11
  35.       Top             =   2640
  36.       Width           =   1575
  37.    End
  38.    Begin VB.CommandButton Command1 
  39.       Caption         =   "Selected Nodes"
  40.       Height          =   375
  41.       Index           =   9
  42.       Left            =   4680
  43.       TabIndex        =   10
  44.       Top             =   4320
  45.       Width           =   1575
  46.    End
  47.    Begin VB.CommandButton Command1 
  48.       Caption         =   "All Items"
  49.       Height          =   375
  50.       Index           =   8
  51.       Left            =   4680
  52.       TabIndex        =   8
  53.       Top             =   3900
  54.       Width           =   1575
  55.    End
  56.    Begin VB.CommandButton Command1 
  57.       Caption         =   "All Links"
  58.       Height          =   375
  59.       Index           =   7
  60.       Left            =   4680
  61.       TabIndex        =   7
  62.       Top             =   3480
  63.       Width           =   1575
  64.    End
  65.    Begin VB.CommandButton Command1 
  66.       Caption         =   "All Nodes"
  67.       Height          =   375
  68.       Index           =   6
  69.       Left            =   4680
  70.       TabIndex        =   6
  71.       Top             =   3060
  72.       Width           =   1575
  73.    End
  74.    Begin VB.CommandButton Command1 
  75.       Caption         =   "Out Links"
  76.       Height          =   375
  77.       Index           =   5
  78.       Left            =   4680
  79.       TabIndex        =   5
  80.       Top             =   2220
  81.       Width           =   1575
  82.    End
  83.    Begin VB.CommandButton Command1 
  84.       Caption         =   "In Links"
  85.       Height          =   375
  86.       Index           =   4
  87.       Left            =   4680
  88.       TabIndex        =   4
  89.       Top             =   1800
  90.       Width           =   1575
  91.    End
  92.    Begin VB.CommandButton Command1 
  93.       Caption         =   "In and Out Links"
  94.       Height          =   375
  95.       Index           =   3
  96.       Left            =   4680
  97.       TabIndex        =   3
  98.       Top             =   1380
  99.       Width           =   1575
  100.    End
  101.    Begin VB.CommandButton Command1 
  102.       Caption         =   "Org Nodes"
  103.       Height          =   375
  104.       Index           =   2
  105.       Left            =   4680
  106.       TabIndex        =   2
  107.       Top             =   960
  108.       Width           =   1575
  109.    End
  110.    Begin VB.CommandButton Command1 
  111.       Caption         =   "Dst Nodes"
  112.       Height          =   375
  113.       Index           =   1
  114.       Left            =   4680
  115.       TabIndex        =   1
  116.       Top             =   540
  117.       Width           =   1575
  118.    End
  119.    Begin VB.CommandButton Command1 
  120.       Caption         =   "In and Out Nodes"
  121.       Height          =   375
  122.       Index           =   0
  123.       Left            =   4680
  124.       TabIndex        =   0
  125.       Top             =   120
  126.       Width           =   1575
  127.    End
  128.    Begin AddFlowLib.AddFlow AddFlow1 
  129.       Height          =   4215
  130.       Left            =   90
  131.       TabIndex        =   13
  132.       Top             =   900
  133.       Width           =   4245
  134.       _Version        =   65536
  135.       _ExtentX        =   7488
  136.       _ExtentY        =   7435
  137.       _StockProps     =   101
  138.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  139.          Name            =   "Arial"
  140.          Size            =   8.25
  141.          Charset         =   0
  142.          Weight          =   400
  143.          Underline       =   0   'False
  144.          Italic          =   0   'False
  145.          Strikethrough   =   0   'False
  146.       EndProperty
  147.       BorderStyle     =   1
  148.       ScrollBars      =   3
  149.       Shape           =   0
  150.       LinkStyle       =   0
  151.       Alignment       =   7
  152.       AutoSize        =   0
  153.       ArrowDst        =   3
  154.       ArrowOrg        =   0
  155.       DrawStyle       =   0
  156.       DrawWidth       =   1,4013e-45
  157.       ReadOnly        =   0   'False
  158.       MultiSel        =   -1  'True
  159.       CanDrawNode     =   -1  'True
  160.       CanDrawLink     =   -1  'True
  161.       CanMoveNode     =   -1  'True
  162.       CanSizeNode     =   -1  'True
  163.       CanStretchLink  =   -1  'True
  164.       CanMultiLink    =   -1  'True
  165.       Transparent     =   0   'False
  166.       ShowGrid        =   0   'False
  167.       Hidden          =   0   'False
  168.       Rigid           =   0   'False
  169.       DisplayHandles  =   -1  'True
  170.       AutoScroll      =   -1  'True
  171.       xGrid           =   7,00649e-45
  172.       yGrid           =   7,00649e-45
  173.       xZoom           =   100
  174.       yZoom           =   100
  175.       FillColor       =   16777215
  176.       DrawColor       =   0
  177.       ForeColor       =   0
  178.       BackPicture     =   "navig.frx":0000
  179.    End
  180.    Begin VB.Label Label1 
  181.       Caption         =   $"navig.frx":001C
  182.       ForeColor       =   &H00FF0000&
  183.       Height          =   615
  184.       Left            =   90
  185.       TabIndex        =   9
  186.       Top             =   210
  187.       Width           =   4335
  188.    End
  189.    Begin VB.Menu FileMenu 
  190.       Caption         =   "&File"
  191.       Begin VB.Menu ExitMenu 
  192.          Caption         =   "&Exit"
  193.       End
  194.    End
  195.    Begin VB.Menu HelpMenu 
  196.       Caption         =   "&?"
  197.       Begin VB.Menu AboutMenu 
  198.          Caption         =   "&About..."
  199.       End
  200.    End
  201. Attribute VB_Name = "Navig"
  202. Attribute VB_Creatable = False
  203. Attribute VB_Exposed = False
  204. Option Explicit
  205. Private Sub AboutMenu_Click()
  206.   MsgBox "AddFlow: navigation methods sample" + Chr(13) + "Copyright 
  207.  1997 Lassalle Technologies"
  208. End Sub
  209. Private Sub Command1_Click(Index As Integer)
  210.   Dim nodx As afNode, lnkx As afLink
  211.   With AddFlow1
  212.     ' Reset draw color of every items (nodes and links)
  213.     For Each nodx In .Nodes
  214.       nodx.DrawColor = RGB(0, 0, 0)
  215.       For Each lnkx In nodx.OutLinks
  216.         lnkx.DrawColor = RGB(0, 0, 0)
  217.       Next
  218.     Next
  219.     ' Change draw color of various collections of items
  220.     Select Case Index
  221.     Case 0
  222.       For Each lnkx In .Nodes(1).OutLinks
  223.         If lnkx.Rigid = False Then
  224.           lnkx.Dst.DrawColor = RGB(255, 0, 0)
  225.         End If
  226.       Next
  227.       For Each lnkx In .Nodes(1).InLinks
  228.         If lnkx.Rigid = False Then
  229.           lnkx.Org.DrawColor = RGB(255, 0, 0)
  230.         End If
  231.       Next
  232.     Case 1
  233.       For Each lnkx In .Nodes(1).OutLinks
  234.         If lnkx.Rigid = False Then
  235.           lnkx.Dst.DrawColor = RGB(255, 0, 0)
  236.         End If
  237.       Next
  238.     Case 2
  239.       For Each lnkx In .Nodes(1).InLinks
  240.         If lnkx.Rigid = False Then
  241.           lnkx.Org.DrawColor = RGB(255, 0, 0)
  242.         End If
  243.       Next
  244.     Case 3
  245.       For Each lnkx In .Nodes(1).OutLinks
  246.         If lnkx.Rigid = False Then
  247.           lnkx.DrawColor = RGB(255, 0, 0)
  248.         End If
  249.       Next
  250.       For Each lnkx In .Nodes(1).InLinks
  251.         If lnkx.Rigid = False Then
  252.           lnkx.DrawColor = RGB(255, 0, 0)
  253.         End If
  254.       Next
  255.     Case 4
  256.       For Each lnkx In .Nodes(1).InLinks
  257.         If lnkx.Rigid = False Then
  258.           lnkx.DrawColor = RGB(255, 0, 0)
  259.         End If
  260.       Next
  261.     Case 5
  262.       For Each lnkx In .Nodes(1).OutLinks
  263.         If lnkx.Rigid = False Then
  264.           lnkx.DrawColor = RGB(255, 0, 0)
  265.         End If
  266.       Next
  267.     Case 6   ' All nodes
  268.       For Each nodx In .Nodes
  269.         nodx.DrawColor = RGB(255, 0, 0)
  270.       Next
  271.     Case 7   ' All links
  272.       For Each nodx In .Nodes
  273.         For Each lnkx In nodx.OutLinks
  274.           lnkx.DrawColor = RGB(255, 0, 0)
  275.         Next
  276.       Next
  277.     Case 8   ' All nodes and links
  278.       For Each nodx In .Nodes
  279.         nodx.DrawColor = RGB(255, 0, 0)
  280.         For Each lnkx In nodx.OutLinks
  281.           lnkx.DrawColor = RGB(255, 0, 0)
  282.         Next
  283.       Next
  284.     Case 9  ' Selected nodes
  285.       For Each nodx In .Nodes
  286.         If nodx.Selected = True Then
  287.           nodx.DrawColor = RGB(255, 0, 0)
  288.         End If
  289.       Next
  290.     Case 10 ' Owned nodes
  291.       For Each lnkx In .Nodes(1).OutLinks
  292.         If lnkx.Rigid = True Then
  293.           lnkx.Dst.DrawColor = RGB(255, 0, 0)
  294.         End If
  295.       Next
  296.     Case 11 ' Selected links
  297.       For Each nodx In .Nodes
  298.         If nodx.Selected = True Then
  299.           For Each lnkx In nodx.OutLinks
  300.             If lnkx.Selected = True Then
  301.               lnkx.DrawColor = RGB(255, 0, 0)
  302.             End If
  303.           Next
  304.         End If
  305.       Next
  306.     End Select
  307.   End With
  308. End Sub
  309. Private Sub ExitMenu_Click()
  310.   End
  311. End Sub
  312. Private Sub Form_Load()
  313.   With AddFlow1
  314.     Dim nodx As afNode, lnkx As afLink
  315.     Set nodx = .Nodes.Add(1050, 1050, 525, 375)
  316.     nodx.Text = "1"
  317.     nodx.Shape = afRectangle
  318.     nodx.FillColor = &HC0FFFF
  319.     Set nodx = .Nodes.Add(1350, 75, 525, 370)
  320.     nodx.Text = "2"
  321.     Set nodx = .Nodes.Add(1950, 675, 600, 300)
  322.     nodx.Text = "3"
  323.     Set nodx = .Nodes.Add(2350, 1200, 500, 500)
  324.     nodx.Text = "4"
  325.     Set nodx = .Nodes.Add(150, 1725, 825, 750)
  326.     nodx.Text = "5: owned by 1"
  327.     Set nodx = .Nodes.Add(225, 300, 500, 500)
  328.     nodx.Text = "6"
  329.     Set nodx = .Nodes.Add(1250, 2800, 500, 500)
  330.     nodx.Text = "7"
  331.     Set nodx = .Nodes.Add(2750, 2000, 825, 750)
  332.     nodx.Text = "8: owned by 1"
  333.     Set nodx = .Nodes.Add(2000, 3100, 825, 750)
  334.     nodx.Text = "9: owned by 8"
  335.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
  336.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(3))
  337.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(6))
  338.     Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(1))
  339.     Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(1))
  340.     Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(7))
  341.     Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(1))
  342.     Set lnkx = .Nodes(9).OutLinks.Add(.Nodes(8))
  343.     ' Links that allow ownership beteen nodes
  344.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(5))
  345.     lnkx.Hidden = True
  346.     lnkx.Rigid = True
  347.     lnkx.Selectable = False
  348.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(8))
  349.     lnkx.Hidden = True
  350.     lnkx.Rigid = True
  351.     lnkx.Selectable = False
  352.     Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(9))
  353.     lnkx.Hidden = True
  354.     lnkx.Rigid = True
  355.     lnkx.Selectable = False
  356.   End With
  357. End Sub
  358.